package cn.sf.sufinguserprovider.serviceImpl;

import cn.sf.pojo.User;
import cn.sf.service.QueryUserService;
import cn.sf.sufinguserprovider.dao.QueryUserMapper;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

@RestController
public class queryUserServiceImpl implements QueryUserService {

    @Resource
    private QueryUserMapper queryUserMapper;


    @RequestMapping("/queryUserDL")
    public User queryUser(String userName,String userPassword) {
        System.out.println("userCode:"+userName);
        return queryUserMapper.queryUser(userName,userPassword);
    }


    @RequestMapping("/queryUserEmailDL")
    public User queryUserEmail(String userEmail, String userPassword) {
        System.out.println("userEmail"+userEmail);
        System.out.println("userPassword"+userPassword);
        return queryUserMapper.queryUserEmail(userEmail,userPassword);
    }



    @Override
    @RequestMapping("/userAddDL")
    public int userAdd(@RequestBody User user) {
        System.out.println("name:"+user.getUserCode());
        return queryUserMapper.userAdd(user);
    }




}
